-
Notifications
You must be signed in to change notification settings - Fork 778
Follow-up to P2546, "Debugging Support" #7642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow-up to P2546, "Debugging Support" #7642
Conversation
The note in `breakpoint` makes a statement of fact about the implementation-defined behaviour. The statement is actually one of intent.
Regarding `breakpoint`: The specific claim that the debugger resumes execution of the program as if the function was not invoked is confusing considering that the debugger may effect side-effects or cause execution to resume from a different evaluation. Instead, the idea is that `breakpoint` is not responsible for causing the translation process to make special accomodations for resumption of execution other than in cases where the debugger was strictly used for observation only.
Describe the possibility of abend.
The note in the description of `is_debugger_present` reads as a statement of fact about the normatively implementation-defined behaviour. Fix this to read as a statement of intent.
The functionality ascribed to POSIX by the wording is not present in POSIX. Update to reference the LSB and to use the corresponding terminology.
The wording implies a preference to return `true` in case it is unknown whether a debugger is present. Add a critical "only" to fix that.
@jwakely @grafikrobot, this is the follow-up from the November 2023 discussion. |
@hubert-reinterpretcast What is the meaning of "abend" in |
"Abend" is a shortened form of "abnormal end." The term is of fairly long standing; I recall it from at least the 1960's when it was used by and in connection with IBM 360 systems software, and it may date from even earlier. When a program "abends," it terminates, often (typically?) for unforeseen reasons.
… On 2025-02-14, at 12:36 AM, Daniel Krügler ***@***.***> wrote:
Dani-Hub
left a comment
(cplusplus/draft#7642)
@hubert-reinterpretcast What is the meaning of "abend" in the program can abend? Should that be "terminate" instead? (I think we have banned the word "abort" unless we specifically refer to std::abort)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
<https://github.com/hubert-reinterpretcast> <#7642 (comment)> <https://github.com/notifications/unsubscribe-auth/AAY4ZGMRRAWMSM6GSSPGWNT2PWFHPAVCNFSM6AAAAABXDNJCRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJYGM4TQNZVGM>
Dani-Hub
left a comment
(cplusplus/draft#7642)
<#7642 (comment)>
@hubert-reinterpretcast <https://github.com/hubert-reinterpretcast> What is the meaning of "abend" in the program can abend? Should that be "terminate" instead? (I think we have banned the word "abort" unless we specifically refer to std::abort)
—
Reply to this email directly, view it on GitHub <#7642 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAY4ZGMRRAWMSM6GSSPGWNT2PWFHPAVCNFSM6AAAAABXDNJCRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJYGM4TQNZVGM>.
You are receiving this because you are subscribed to this thread.
|
I agree it's an established term, but if it's not well known then it doesn't help in a note that's intended to add clarification. Otherwise this looks like a good improvement. |
Thanks for the explanation. Could we possibly replace "the program can abend" by "the program can end abnormally" instead? |
Address review feedback ("abend" is not a well-known term).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hubert-reinterpretcast for the improved wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did I mention that I was opposed to adding those functions to start with? A note is obviously not the right tool to specify them, but we lack the normative framework to put the specification in a "recommended practice". (end of rant)
@jwakely should see this change.
only when tracing the execution of the program with a debugger. On Windows or | ||
equivalent systems, this can be achieved by calling the | ||
\tcode{::IsDebuggerPresent()} Win32 function. For systems compatible with | ||
ISO/IEC 23360:2021, this can be achieved by checking for a tracing process, with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This replaces "POSIX" with "Linux Standard Base". Is there a particular reason for that? Does POSIX not cover the needed functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although ptrace
is present in most UNIX-like systems, it isn't part of POSIX. The LSB is a much narrower scope than POSIX, but it is a standard, unlike families like "BSD" or "SysV". So if we want a standard that includes ptrace
, LSB makes sense.
However, the wording never mentions prrace
it just talks about "tracing" and "a tracer parent process" which is still meaningful even in e.g. HP-UX which replaced ptrace
with ttrace
, and in Solaris through ptrace
but also via procfs. So maybe it's OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, the wording never mentions
prrace
it just talks about "tracing" and "a tracer parent process" which is still meaningful even in e.g. HP-UX which replacedptrace
withttrace
, and in Solaris throughptrace
but also via procfs. So maybe it's OK.
Using "POSIX" in conjunction with the handwaving implies that the handwaving is necessarily meaningful for all possible implementations of POSIX. That it is probably meaningful for extant implementations of POSIX does not make me feel any better about using "POSIX" without qualification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the change to refer to the LSB. What does it imply for e.g. macOS, which is not Windows and isn't compatible with the LSB either?
Not that "On POSIX" was really great wording either.
I would like to err on the side of "saying nothing wrong". Which is to say that, saying nothing for macOS (or any other non-Windows, non-LSB platform) leaves people the freedom to see whether the LSB implementation hint can be adapted for macOS, etc. without implying that the hint is applicable in cases where it isn't. |
Yeah that makes sense |
@jensmaurer @jwakely, are we good with the current proposed change then? |
Is all this to be squashed? |
Yes, please squash and fix the commit message. |
Follow-up to #6681 (P2546R5) from thread beginning with edit/2023/11/0870.
breakpoint
assumes that a debugger is present (and should instead cover both cases).is_debugger_present
for POSIX makes assumptions that are more appropriate for the LSB.is_debugger_present
implies the wrong trade-off when it is unknown whether a debugger is present. Clarify to prefer returningfalse
.